package com.buer.storage.business.service.impl;


import com.buer.storage.business.dao.SupplierDao;
import com.buer.storage.business.domain.Supplier;
import com.buer.storage.business.dto.SupplierDto;
import com.buer.storage.business.service.SupplierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService {
    @Resource
    private SupplierDao supplierDao;

    @Override
    public int insert(SupplierDto supplierDto) {
        return supplierDao.insert(supplierDto);
    }

    @Override
    public int delete(int supplierId) {
        return supplierDao.delete(supplierId);
    }

    @Override
    public int update(Supplier supplier) {
        return supplierDao.update(supplier);
    }

    @Override
    public List<Supplier> findAllSupplier() {
        List<Supplier> supplier = supplierDao.findAllSupplier();
        return supplier;
    }

    @Override
    public List<Supplier> searchSupplier(String supplierCode, String supplierName) {
        List<Supplier> supplier = supplierDao.searchSupplier(supplierCode, supplierName);
        return supplier;
    }
}
